Micron Document
πŸŽ–οΈGitΠ―Ρ€Π°πŸŽ–οΈ

Node / meshtastic / Meshtastic-Android / files / .github / agents / speckit.clarify.agent.md

Displaying Rendered β€’ View raw β€’ Download

.github/agents/speckit.clarify.agent.md gh-readonly-queue/main/pr-5954-e8fb0d3632384411e1ab015c806a2ae3631fcc42 (3b09b6ac) Text, 14.09 KB

description: Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.
handoffs:
β€’ label: Build Technical Plan
agent: speckit.plan
prompt: Create a plan for the spec. I am building with...

User Input

T282828
$ARGUMENTS

You MUST consider the user input before proceeding (if not empty).

Pre-Execution Checks

Check for extension hooks (before clarification):
β€’ Check if T383838.specify/extensions.yml exists in the project root.
β€’ If it exists, read it and look for entries under the T383838hooks.before_clarify key
β€’ If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
β€’ Filter out hooks where T383838enabled is explicitly T383838false. Treat hooks without an T383838enabled field as enabled by default.
β€’ For each remaining hook, do not attempt to interpret or evaluate hook T383838condition expressions:
β€’ If the hook has no T383838condition field, or it is null/empty, treat the hook as executable
β€’ If the hook defines a non-empty T383838condition, skip the hook and leave condition evaluation to the HookExecutor implementation
β€’ For each executable hook, output the following based on its T383838optional flag:
β€’ Optional hook (T383838optional: true):
T282828
## Extension Hooks

**Optional Pre-Hook**: {extension}
Command: \`/{command}\`
Description: {description}

Prompt: {prompt}
To execute: \`/{command}\`
β€’ Mandatory hook (T383838optional: false):
T282828
## Extension Hooks

**Automatic Pre-Hook**: {extension}
Executing: \`/{command}\`
EXECUTE_COMMAND: {command}

Wait for the result of the hook command before proceeding to the Outline.
β€’ If no hooks are registered or T383838.specify/extensions.yml does not exist, skip silently

Outline

Goal: Detect and reduce ambiguity or missing decision points in the active feature specification and record the clarifications directly in the spec file.

Note: This clarification workflow is expected to run (and be completed) BEFORE invoking T383838/speckit.plan. If the user explicitly states they are skipping clarification (e.g., exploratory spike), you may proceed, but must warn that downstream rework risk increases.

Execution steps:

1. Run T383838.specify/scripts/bash/check-prerequisites.sh --json --paths-only from repo root once (combined T383838--json --paths-only mode / T383838-Json -PathsOnly). Parse minimal JSON payload fields:
β€’ T383838FEATURE_DIR
β€’ T383838FEATURE_SPEC
β€’ (Optionally capture T383838IMPL_PLAN, T383838TASKS for future chained flows.)
β€’ If JSON parsing fails, abort and instruct user to re-run T383838/speckit.specify or verify feature branch environment.
β€’ For single quotes in args like "I'm Groot", use escape syntax: e.g 'I'\''m Groot' (or double-quote if possible: "I'm Groot").

2. Load the current spec file. Perform a structured ambiguity & coverage scan using this taxonomy. For each category, mark status: Clear / Partial / Missing. Produce an internal coverage map used for prioritization (do not output raw map unless no questions will be asked).

Functional Scope & Behavior:
β€’ Core user goals & success criteria
β€’ Explicit out-of-scope declarations
β€’ User roles / personas differentiation

Domain & Data Model:
β€’ Entities, attributes, relationships
β€’ Identity & uniqueness rules
β€’ Lifecycle/state transitions
β€’ Data volume / scale assumptions

Interaction & UX Flow:
β€’ Critical user journeys / sequences
β€’ Error/empty/loading states
β€’ Accessibility or localization notes

Non-Functional Quality Attributes:
β€’ Performance (latency, throughput targets)
β€’ Scalability (horizontal/vertical, limits)
β€’ Reliability & availability (uptime, recovery expectations)
β€’ Observability (logging, metrics, tracing signals)
β€’ Security & privacy (authN/Z, data protection, threat assumptions)
β€’ Compliance / regulatory constraints (if any)

Integration & External Dependencies:
β€’ External services/APIs and failure modes
β€’ Data import/export formats
β€’ Protocol/versioning assumptions

Edge Cases & Failure Handling:
β€’ Negative scenarios
β€’ Rate limiting / throttling
β€’ Conflict resolution (e.g., concurrent edits)

Constraints & Tradeoffs:
β€’ Technical constraints (language, storage, hosting)
β€’ Explicit tradeoffs or rejected alternatives

Terminology & Consistency:
β€’ Canonical glossary terms
β€’ Avoided synonyms / deprecated terms

Completion Signals:
β€’ Acceptance criteria testability
β€’ Measurable Definition of Done style indicators

Misc / Placeholders:
β€’ TODO markers / unresolved decisions
β€’ Ambiguous adjectives ("robust", "intuitive") lacking quantification

For each category with Partial or Missing status, add a candidate question opportunity unless:
β€’ Clarification would not materially change implementation or validation strategy
β€’ Information is better deferred to planning phase (note internally)

3. Generate (internally) a prioritized queue of candidate clarification questions (maximum 5). Do NOT output them all at once. Apply these constraints:
β€’ Maximum of 5 total questions across the whole session.
β€’ Each question must be answerable with EITHER:
β€’ A short multiple‑choice selection (2–5 distinct, mutually exclusive options), OR
β€’ A one-word / short‑phrase answer (explicitly constrain: "Answer in <=5 words").
β€’ Only include questions whose answers materially impact architecture, data modeling, task decomposition, test design, UX behavior, operational readiness, or compliance validation.
β€’ Ensure category coverage balance: attempt to cover the highest impact unresolved categories first; avoid asking two low-impact questions when a single high-impact area (e.g., security posture) is unresolved.
β€’ Exclude questions already answered, trivial stylistic preferences, or plan-level execution details (unless blocking correctness).
β€’ Favor clarifications that reduce downstream rework risk or prevent misaligned acceptance tests.
β€’ If more than 5 categories remain unresolved, select the top 5 by (Impact * Uncertainty) heuristic.

4. Sequential questioning loop (interactive):
β€’ Present EXACTLY ONE question at a time.
β€’ For multiple‑choice questions:
β€’ Analyze all options and determine the most suitable option based on:
β€’ Best practices for the project type
β€’ Common patterns in similar implementations
β€’ Risk reduction (security, performance, maintainability)
β€’ Alignment with any explicit project goals or constraints visible in the spec
β€’ Present your recommended option prominently at the top with clear reasoning (1-2 sentences explaining why this is the best choice).
β€’ Format as: T383838**Recommended:** Option [X] - <reasoning>
β€’ Then render all options as a Markdown table:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Option β”‚ Description β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ A β”‚ <Option A description> β”‚
β”‚ B β”‚ <Option B description> β”‚
β”‚ C β”‚ <Option C description> (add D/E as needed up to 5) β”‚
β”‚ Short β”‚ Provide a different short answer (<=5 words) (Include only if free-form alternative is… β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

β€’ After the table, add: T383838You can reply with the option letter (e.g., "A"), accept the recommendation by saying "yes" or "recommended", or provide your own short answer.
β€’ For short‑answer style (no meaningful discrete options):
β€’ Provide your suggested answer based on best practices and context.
β€’ Format as: T383838**Suggested:** <your proposed answer> - <brief reasoning>
β€’ Then output: T383838Format: Short answer (<=5 words). You can accept the suggestion by saying "yes" or "suggested", or provide your own answer.
β€’ After the user answers:
β€’ If the user replies with "yes", "recommended", or "suggested", use your previously stated recommendation/suggestion as the answer.
β€’ Otherwise, validate the answer maps to one option or fits the <=5 word constraint.
β€’ If ambiguous, ask for a quick disambiguation (count still belongs to same question; do not advance).
β€’ Once satisfactory, record it in working memory (do not yet write to disk) and move to the next queued question.
β€’ Stop asking further questions when:
β€’ All critical ambiguities resolved early (remaining queued items become unnecessary), OR
β€’ User signals completion ("done", "good", "no more"), OR
β€’ You reach 5 asked questions.
β€’ Never reveal future queued questions in advance.
β€’ If no valid questions exist at start, immediately report no critical ambiguities.

5. Integration after EACH accepted answer (incremental update approach):
β€’ Maintain in-memory representation of the spec (loaded once at start) plus the raw file contents.
β€’ For the first integrated answer in this session:
β€’ Ensure a T383838## Clarifications section exists (create it just after the highest-level contextual/overview section per the spec template if missing).
β€’ Under it, create (if not present) a T383838### Session YYYY-MM-DD subheading for today.
β€’ Append a bullet line immediately after acceptance: T383838- Q: <question> β†’ A: <final answer>.
β€’ Then immediately apply the clarification to the most appropriate section(s):
β€’ Functional ambiguity β†’ Update or add a bullet in Functional Requirements.
β€’ User interaction / actor distinction β†’ Update User Stories or Actors subsection (if present) with clarified role, constraint, or scenario.
β€’ Data shape / entities β†’ Update Data Model (add fields, types, relationships) preserving ordering; note added constraints succinctly.
β€’ Non-functional constraint β†’ Add/modify measurable criteria in Success Criteria > Measurable Outcomes (convert vague adjective to metric or explicit target).
β€’ Edge case / negative flow β†’ Add a new bullet under Edge Cases / Error Handling (or create such subsection if template provides placeholder for it).
β€’ Terminology conflict β†’ Normalize term across spec; retain original only if necessary by adding T383838(formerly referred to as "X") once.
β€’ If the clarification invalidates an earlier ambiguous statement, replace that statement instead of duplicating; leave no obsolete contradictory text.
β€’ Save the spec file AFTER each integration to minimize risk of context loss (atomic overwrite).
β€’ Preserve formatting: do not reorder unrelated sections; keep heading hierarchy intact.
β€’ Keep each inserted clarification minimal and testable (avoid narrative drift).

6. Validation (performed after EACH write plus final pass):
β€’ Clarifications session contains exactly one bullet per accepted answer (no duplicates).
β€’ Total asked (accepted) questions ≀ 5.
β€’ Updated sections contain no lingering vague placeholders the new answer was meant to resolve.
β€’ No contradictory earlier statement remains (scan for now-invalid alternative choices removed).
β€’ Markdown structure valid; only allowed new headings: T383838## Clarifications, T383838### Session YYYY-MM-DD.
β€’ Terminology consistency: same canonical term used across all updated sections.

7. Write the updated spec back to T383838FEATURE_SPEC.

8. Report completion (after questioning loop ends or early termination):
β€’ Number of questions asked & answered.
β€’ Path to updated spec.
β€’ Sections touched (list names).
β€’ Coverage summary table listing each taxonomy category with Status: Resolved (was Partial/Missing and addressed), Deferred (exceeds question quota or better suited for planning), Clear (already sufficient), Outstanding (still Partial/Missing but low impact).
β€’ If any Outstanding or Deferred remain, recommend whether to proceed to T383838/speckit.plan or run T383838/speckit.clarify again later post-plan.
β€’ Suggested next command.

Behavior rules:

β€’ If no meaningful ambiguities found (or all potential questions would be low-impact), respond: "No critical ambiguities detected worth formal clarification." and suggest proceeding.
β€’ If spec file missing, instruct user to run T383838/speckit.specify first (do not create a new spec here).
β€’ Never exceed 5 total asked questions (clarification retries for a single question do not count as new questions).
β€’ Avoid speculative tech stack questions unless the absence blocks functional clarity.
β€’ Respect user early termination signals ("stop", "done", "proceed").
β€’ If no questions asked due to full coverage, output a compact coverage summary (all categories Clear) then suggest advancing.
β€’ If quota reached with unresolved high-impact categories remaining, explicitly flag them under Deferred with rationale.

Context for prioritization: $ARGUMENTS

Post-Execution Checks

Check for extension hooks (after clarification):
Check if T383838.specify/extensions.yml exists in the project root.
β€’ If it exists, read it and look for entries under the T383838hooks.after_clarify key
β€’ If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
β€’ Filter out hooks where T383838enabled is explicitly T383838false. Treat hooks without an T383838enabled field as enabled by default.
β€’ For each remaining hook, do not attempt to interpret or evaluate hook T383838condition expressions:
β€’ If the hook has no T383838condition field, or it is null/empty, treat the hook as executable
β€’ If the hook defines a non-empty T383838condition, skip the hook and leave condition evaluation to the HookExecutor implementation
β€’ For each executable hook, output the following based on its T383838optional flag:
β€’ Optional hook (T383838optional: true):
T282828
## Extension Hooks

**Optional Hook**: {extension}
Command: \`/{command}\`
Description: {description}

Prompt: {prompt}
To execute: \`/{command}\`
β€’ Mandatory hook (T383838optional: false):
T282828
## Extension Hooks

**Automatic Hook**: {extension}
Executing: \`/{command}\`
EXECUTE_COMMAND: {command}
β€’ If no hooks are registered or T383838.specify/extensions.yml does not exist, skip silently

Served by rngit 1.5.2 - Generated in 0.08s